package com.base;

import java.io.Serializable;
import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.util.Page;



@Transactional
public class BaseServiceImpl<T> implements BaseService<T>{

	BaseDao bd;
	public void setBd(BaseDao bd) {
		this.bd = bd;
	}
	@Override
	public void save(T t) {
		bd.save(t);		
	}

	@Override
	public void delete(Serializable id) {
		bd.delete(get(id));
	}

	@Override
	public void update(T t) {
		bd.update(t);
	}

	@Override
	public T get(Serializable id) {
		return (T) bd.get(id);
	}

	@Override
	public List<T> getAll() {
		return bd.getAll();
	}

	@Override
	public Page getPage(T t, Page p, String sql) {
		return bd.getPage(t, p, sql);
	}

}
